﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) CompanyName.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	#region Using Statements
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	using MbUnit.Framework;

	using Describe = MbUnit.Framework.TestsOnAttribute;
	using InContext = MbUnit.Framework.DescriptionAttribute;
	using It = MbUnit.Framework.TestAttribute;
	using Should = MbUnit.Framework.DescriptionAttribute;
	using By = MbUnit.Framework.AuthorAttribute;
	using Tag = MbUnit.Framework.CategoryAttribute;
	#endregion

	[
		Describe(typeof(AccountClient)),
		InContext("should perform its specified behavor."),
		Tag("Functional"),
		By("Michael Herndon", "mherndon@opensourceconnections.com", "www.amptools.net")
	]
	public class AccountClientSpec : Spec
	{

		[It, Should(" verify that the user can log in. ")]
		public void Verify()
		{
			AccountClient client = Twitter.CreateAccountClient();
			client.Verify().Authorized.ShouldBeTrue();
		}

		[It, Should(" let the user update his/her location ")]
		public void UpdateLocation()
		{
			AccountClient client = Twitter.CreateAccountClient();
			User user = client.UpdateLocation("here");
			user.ShouldNotBeNull();
			user.location.ShouldBe("here");
		}

		[It, Should(" let the user update his/her notification device ")]
		public void UpdateTheNotificationDevice()
		{
			AccountClient client = Twitter.CreateAccountClient();
			User user = client.UpdateDeliveryDevice(DeliveryDevices.None);
			user.ShouldNotBeNull();
		}


		[It, Should(" retrieve vital information on the rate status limit. ")]
		public void GetRateStatusLimit()
		{
			AccountClient client = Twitter.CreateAccountClient();
			RateStatus status = client.GetRateStatusLimit();
			status.ShouldNotBeNull(); 
			status.HourlyLimit.ShouldBeGreaterThan(0);
		}

		[It, Should(" end the users session. ")]
		public void EndSession()
		{
			AccountClient client = Twitter.CreateAccountClient();
			client.EndSession();
		}
	}
}
